package com.aaa.system.service.impl;

import com.aaa.entity.LoginLog;
import com.aaa.entity.Role;
import com.aaa.entity.SysDictData;
import com.aaa.system.dao.LoginLogDao1;
import com.aaa.system.dao.RoleDao;
import com.aaa.system.service.LoginLogServce1;
import com.aaa.system.service.RoleService;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 崔灿
 * @Date 2023/03/01 10:34
 * @ClassName LoginLogServiceImpl1
 * @Description
 * @Version 1.0
 */

@Service
public class LoginLogServiceImpl1 extends ServiceImpl<LoginLogDao1, LoginLog> implements LoginLogServce1 {

    @Autowired
    private LoginLogDao1 loginLogDao1;

    @Override
    public Result loginlog(Integer currentPage, Integer pageSize, LoginLog loginLog) {
        QueryWrapper<LoginLog> wrapper = new QueryWrapper<>();
        wrapper.like(loginLog.getLoginName()!=null,"login_name",loginLog.getLoginName());
        PageHelper.startPage(currentPage, pageSize);
        List<LoginLog> loginLogs = loginLogDao1.selectList(wrapper);
        PageInfo<LoginLog> sysDictTypePageInfo = new PageInfo<>(loginLogs);
        return new Result(2000,"成功",sysDictTypePageInfo);
    }
}
